To
add a column to a list or document library, switch to the List ribbon
or the Library ribbon and click the Create Column button in the Manage
Views section of the ribbon, as shown in Figure 1.
Note
The
Create Column option creates a new column in the list or library but
does not let you select from the site columns that are already set up
in the site.
Choosing the Create
Column option opens a dialog where you can define the type of column
you want to add, as well as choose the settings on that column (see Figure 2).
The first choice to make is the
name of the column. Column names must be unique in the list; that is,
you can’t have two columns with the exact same name.
After choosing the name for the column, you must choose the type of the column, as shown in Figure 7.10.
There are numerous types of columns, and developers can add to those
types, so you might see more than the built-in types shown in the
figures in this book.
All
column types require you to choose a name for the column. They also
allow you to specify the description for the column and whether the
column is required (making the column mandatory in the list, forcing
the user to fill it in when creating or editing an item) and whether
the column should be added to the default view of the list or library.
Except for the column type, all options can be modified in the future.
Changing the column type for a column is possible but is limited to
certain column types.
However, each column type
can offer different configuration options for that column. For example,
a Single Line of Text column type has a Maximum Number of Characters
setting, whereas a Multiple Lines of Text column type has a
Configuration option for how many lines it should allow.
Some column types also have
an option for more complex validation settings, under the heading
Column Validation. Other columns do not support this type of complex validation.